//
//  TiQianJieVC.m
//  digitalCurrency
//
//  Created by 小震GG on 2019/11/20.
//  Copyright © 2019 XinHuoKeJi. All rights reserved.
//

#import "TiQianJieVC.h"

@interface TiQianJieVC ()

@property (nonatomic, strong) UILabel *lastLB;

@property (nonatomic, strong) UILabel *LB1;
@property (nonatomic, strong) UILabel *LB2;
@property (nonatomic, strong) UILabel *LB3;
@property (nonatomic, strong) UILabel *LB4;

@end

@implementation TiQianJieVC

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = tBgQianColor;
    
    if ([self.isTiQianStr isEqualToString:@"1"]) {
        self.viewTitle.text = LocalizationKey(@"提前结清");
    }
    else{
        self.viewTitle.text = LocalizationKey(@"偿还本期");
    }
    
    [self setTopView];
}

- (void)setTopView{
    
    UILabel *lastTitleLB = [[UILabel alloc]init];
    [self.view addSubview:lastTitleLB];
    [lastTitleLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(16);
        make.top.equalTo(46);
    }];
    lastTitleLB.textColor = tSixColor;
    lastTitleLB.font = kFontPF_Medium(17);
    
    if ([self.isTiQianStr isEqualToString:@"1"]) {
        lastTitleLB.text = LocalizationKey(@"剩余应还款总额");
       }
    else{
        lastTitleLB.text = LocalizationKey(@"本期应偿还金额");
    }
    
    self.lastLB = [[UILabel alloc]init];
    [self.view addSubview:self.lastLB];
    [self.lastLB mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(-18);
        make.centerY.equalTo(lastTitleLB);
    }];
    self.lastLB.textColor = tThreeColor;
    self.lastLB.font = kFontPF_Medium(36);
    self.lastLB.text = @"00.00";
    
    UIView *lineView = [[UIView alloc]init];
    [self.view addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(16);
        make.right.equalTo(-16);
        make.top.equalTo(108);
        make.height.equalTo(0.5);
    }];
    lineView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.1];
    
    UILabel *titleLB1 = [[UILabel alloc]init];
    [self.view addSubview:titleLB1];
    [titleLB1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(16);
        make.top.equalTo(lineView.mas_bottom).offset(40);
    }];
    titleLB1.textColor = tNineColor;
    titleLB1.font = kFont(14);
    titleLB1.text = LocalizationKey(@"剩余应还期");
    
    UILabel *titleLB2 = [[UILabel alloc]init];
    [self.view addSubview:titleLB2];
    [titleLB2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(16);
        make.top.equalTo(titleLB1.mas_bottom).offset(30);
    }];
    titleLB2.textColor = tNineColor;
    titleLB2.font = kFont(14);
    titleLB2.text = LocalizationKey(@"每期应还款");
    
    UILabel *titleLB3 = [[UILabel alloc]init];
    [self.view addSubview:titleLB3];
    [titleLB3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(16);
        make.top.equalTo(titleLB2.mas_bottom).offset(30);
    }];
    titleLB3.textColor = tNineColor;
    titleLB3.font = kFont(14);
    titleLB3.text = LocalizationKey(@"提前结清服务费");
    
    self.LB1 = [[UILabel alloc]init];
    [self.view addSubview:self.LB1];
    [self.LB1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(-16);
        make.top.equalTo(lineView.mas_bottom).offset(40);
    }];
    self.LB1.textColor = tThreeColor;
    self.LB1.font = kFont(14);
    self.LB1.text = LocalizationKey(@"--");
    
    self.LB2 = [[UILabel alloc]init];
    [self.view addSubview:self.LB2];
    [self.LB2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(-16);
        make.top.equalTo(titleLB1.mas_bottom).offset(30);
    }];
    self.LB2.textColor = tThreeColor;
    self.LB2.font = kFont(14);
    self.LB2.text = LocalizationKey(@"--");
    
    self.LB3 = [[UILabel alloc]init];
    [self.view addSubview:self.LB3];
    [self.LB3 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(-16);
        make.top.equalTo(titleLB2.mas_bottom).offset(30);
    }];
    self.LB3.textColor = tThreeColor;
    self.LB3.font = kFont(14);
    self.LB3.text = LocalizationKey(@"--");
    
    if ([self.isTiQianStr isEqualToString:@"1"]) {
        
       }
    else{
        UILabel *titleLB4 = [[UILabel alloc]init];
        [self.view addSubview:titleLB4];
        [titleLB4 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(16);
            make.top.equalTo(titleLB3.mas_bottom).offset(30);
        }];
        titleLB4.textColor = tNineColor;
        titleLB4.font = kFont(14);
        titleLB4.text = LocalizationKey(@"罚息");
        
        self.LB4 = [[UILabel alloc]init];
        [self.view addSubview:self.LB4];
        [self.LB4 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(-16);
            make.top.equalTo(titleLB3.mas_bottom).offset(30);
        }];
        self.LB4.textColor = [UIColor colorWithHEX:@"#FF0D21"];
        self.LB4.font = kFont(14);
        self.LB4.text = LocalizationKey(@"--");
        
    }
    
    UIButton *okBtn = [[UIButton alloc]init];
    [self.view addSubview:okBtn];
    [okBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(titleLB3.mas_bottom).offset(150);
        make.centerX.equalTo(0);
        make.width.equalTo(280);
        make.height.equalTo(48);
    }];
    okBtn.backgroundColor = tMainColor;
    [okBtn setTitle:LocalizationKey(@"立即还款") forState:UIControlStateNormal];
    [okBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    okBtn.titleLabel.font = kFont(19);
    okBtn.layer.cornerRadius = 24.0;
    [okBtn addTarget:self action:@selector(okBtnAct) forControlEvents:UIControlEventTouchUpInside];
}

- (void)okBtnAct{
    
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
